# Maintainer: @naveen521kk on Github, Naveen M K <naveen@syrusdark.website>

_perlname=Mozilla-CA
_realname="${_perlname,,}"
pkgbase=mingw-w64-perl-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-perl-${_realname}")
pkgver=20200520
pkgrel=2
pkgdesc="Mozilla's CA cert bundle in PEM format (mingw-w64)"
arch=('any')
url="https://metacpan.org/release/${_perlname}"
groups=("${MINGW_PACKAGE_PREFIX}-perl-modules")
depends=(
  "${MINGW_PACKAGE_PREFIX}-perl"
)
options=('!emptydirs')
makedepends=("${MINGW_PACKAGE_PREFIX}-python")
license=(unknown)
source=(
  "https://cpan.metacpan.org/authors/id/A/AB/ABH/${_perlname}-${pkgver}.tar.gz"
  "patchmakefile.py"
)
sha512sums=('5bc7c43c55baa3f878fd2dbf1c85d6b20dcdc9e54ae073d1be4f6b808fa5a4b1205428b7967b5f752b31a62464a8b5cc67b32b3f70b834a4da9c39efe3d5d59f'
            'd7ec5ba4a3d75f674f4028e8a53bc4177ab71a379bc63affebf910e1d5a0e491b6642318218b55ddc4d90e0125d61e4b97626782af57d44522bcb5543fb21cb2')

build() {
  cd "$srcdir/${_perlname}-${pkgver}"
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL
  export pkgdir=$pkgdir
  python $srcdir/patchmakefile.py
  mingw32-make
}

package() {
  cd "$srcdir/${_perlname}-${pkgver}"
  mingw32-make DESTDIR="${pkgdir}/" install
}
